

/**
 * @BelongsProject : LeetCode
 * @Author : WXY
 * @CreateTime : 2022-12-07  11:27
 * @Description : 剑指 Offer 11. 旋转数组的最小数字
 *              解释： 找最小值
 * @Version : 1.0
 */

public class Num11_minArray {
    public int minArray1(int[] numbers) {
        int min = numbers[0];
        for (int i = 1; i < numbers.length; i++) {
            if (numbers[i] < min) {
                min = numbers[i];
            }
        }
        return min;
    }
    public int minArray(int[] numbers) {
        for (int i = 1; i < numbers.length; i++) {
            if (numbers[i - 1] >numbers[i]) {
                return numbers[i];
            }
        }
        return numbers[0];
    }

}
